// 将用户名显示出来
    $(function(){
        var usercook = tool.getCookie('phone');
        if(usercook){
            $('.ulest').empty().append(
                `
                    <li><a href="home.html">${usercook}</a></li>    
                    <a class="logout" href = "javascript:;" >退出</a>
            `
            )
            $('.logout').click(function(){
            layer.confirm('你确认要退出吗？', {
                btn: ['残忍离开','我再想想'] //按钮
            }, function(){
                layer.msg('退出成功', {
                    icon: 1,
                    time:1500
                },function(){
                    tool.removeCookie('phone');
                    var str = `
                        <li>
                            <a href="login.html">登录</a>
                        </li>
                        <li>
                            <a href="register.html">注册</a>
                        </li>
                    `
                    $('.ulest').html(str)
                });
            }, function(){
                layer.msg('取消退出', {
                    time: 1500, //20s后自动关闭
                });
            });
            return false;
        })
    }
})
    
    